const { BrowserWindow, Menu } = require('electron')
const handlerIpc = require('../ipc')


let mainWindow

function createMainWindow() {

    // Menu.setApplicationMenu(null)
    mainWindow = new BrowserWindow({
        height: 530,
        useContentSize: true,
        width: 350,
        resizable: false,
        // frame: false,
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: false,
        }
    })

    mainWindow.loadURL("http://localhost:8080/")
    mainWindow.on('closed', () => {
        mainWindow = null
    })

    handlerIpc(mainWindow)
}


module.exports = createMainWindow
